package com.codingapi.websocket.core.util;

import io.netty.channel.ChannelHandlerContext;

/**
 * @author modificial
 * @date 2018/7/19
 * @company codingApi
 * @description 获取通道id
 */
public class ChannelUtil {
    public static String getChannelCtxId(ChannelHandlerContext ctx) {
        if (ctx == null) {
            return null;
        }
        String id = ctx.channel().id().asLongText();
        return id;
    }
}
